package com.kaifamiao.memory;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;

public class StringStreamTest {

    public static void main(String[] args) throws IOException {

        // 内部用 字符缓冲区 缓存数据
        StringWriter w = new StringWriter();

        w.write('爽');
        w.write(':');
        w.write('\n');
        w.write('\t');
        w.write("你好，你们班那个阿芳最近睡觉怎么样？");

        final String str = w.toString();

        StringReader r = new StringReader( str );

        int c ;
        while( ( c = r.read() ) != -1 ){
            char ch = (char)c;
            System.out.print( ch );
        }


    }

}
